<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Taskflow Handbook</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="https://taskflow.github.io/">Taskflow</a>
   &#160;<span id="projectnumber">3.0.0-Master-Branch</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('flow__builder_8hpp_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">flow_builder.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="flow__builder_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="task_8hpp.html">task.hpp</a>&quot;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacetf.html">tf</a> {</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html">   17</a></span>&#160;<span class="keyword">class </span><a class="code" href="classtf_1_1FlowBuilder.html">FlowBuilder</a> {</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classtf_1_1Executor.html">Executor</a>;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;  <span class="keyword">public</span>:</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, </div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;      std::enable_if_t&lt;is_static_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;    &gt;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(C&amp;&amp; callable);</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    </div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, </div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;      std::enable_if_t&lt;is_dynamic_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    &gt;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(C&amp;&amp; callable);</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    </div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, </div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;      std::enable_if_t&lt;is_condition_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span></div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    &gt;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(C&amp;&amp; callable);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span>... C, std::enable_if_t&lt;(<span class="keyword">sizeof</span>...(C)&gt;1), <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span>&gt;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">auto</span> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(C&amp;&amp;... callables);</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a0a01192f4f92c15380a4f259e2fec2d9">composed_of</a>(<a class="code" href="classtf_1_1Taskflow.html">Taskflow</a>&amp; taskflow);</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#acab0b4ac82260f47fdb36a3244ee3aaf">placeholder</a>();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#ifdef TF_ENABLE_CUDA</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, </div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;      std::enable_if_t&lt;is_cudaflow_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span></div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    &gt;</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(C&amp;&amp; callable);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    </div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, <span class="keyword">typename</span> D, </div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;      std::enable_if_t&lt;is_cudaflow_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;* = <span class="keyword">nullptr</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    &gt;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#afdf47fd1a358fb64f8c1b89e2a393169">emplace_on</a>(C&amp;&amp; callable, D&amp;&amp; device);</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">linearize</a>(<a class="codeRef" doxygen="/Users/twhuang/PhD/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Task&gt;</a>&amp; tasks);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">linearize</a>(<a class="codeRef" doxygen="/Users/twhuang/PhD/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/utility/initializer_list.html">std::initializer_list&lt;Task&gt;</a> tasks);</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="comment">// parallel iterations</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    </div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> C&gt;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a564252001be679600b20ca9ed9920f6a">for_each</a>(B&amp;&amp; first, E&amp;&amp; last, C&amp;&amp; callable);</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    </div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a1a294c4fa23d74b82e581b8cfd33acdf">for_each_guided</a>(B&amp;&amp; beg, E&amp;&amp; end, C&amp;&amp; callable, H&amp;&amp; chunk_size = 1);</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    </div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a5c044a80450742bf6927d0c343c23853">for_each_dynamic</a>(B&amp;&amp; beg, E&amp;&amp; end, C&amp;&amp; callable, H&amp;&amp; chunk_size = 1);</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    </div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a0af7e250c4ad1ae98bf6e0249b98589f">for_each_static</a>(</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;      B&amp;&amp; beg, E&amp;&amp; end, C&amp;&amp; callable, H&amp;&amp; chunk_size = 0</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    );</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    </div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> S, <span class="keyword">typename</span> C&gt;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#ab8417b211b18bb1e0f45a049331f084d">for_each_index</a>(B&amp;&amp; first, E&amp;&amp; last, S&amp;&amp; step, C&amp;&amp; callable);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    </div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> S, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a942449afd25e656b9e14cb526cbd8ad2">for_each_index_guided</a>(</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;      B&amp;&amp; beg, E&amp;&amp; end, S&amp;&amp; step, C&amp;&amp; callable, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    );</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    </div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> S, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a930d0343226874d1d40b9e230cccdd52">for_each_index_dynamic</a>(</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;      B&amp;&amp; beg, E&amp;&amp; end, S&amp;&amp; step, C&amp;&amp; callable, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    );</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    </div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> S, <span class="keyword">typename</span> C, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a71f204c670ca5857e5527d6000ba73c4">for_each_index_static</a>(</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;      B&amp;&amp; beg, E&amp;&amp; end, S&amp;&amp; step, C&amp;&amp; callable, H&amp;&amp; chunk_size = 0</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    );</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    <span class="comment">// reduction</span></div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> O&gt;</div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#ad999cd75045db225a42d5881d6db1223">reduce</a>(B&amp;&amp; first, E&amp;&amp; last, T&amp; init, O&amp;&amp; bop);</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> O, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a10f13b39b02038c6850aca787923d668">reduce_guided</a>(</div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, O&amp;&amp; bop, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    );</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;    </div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> O, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a83ec799606b7526787761acf27885b00">reduce_dynamic</a>(</div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, O&amp;&amp; bop, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;    );</div><div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;    </div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> O, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a54e36c916ae7dd88bd079d3fd49119f9">reduce_static</a>(</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, O&amp;&amp; bop, H&amp;&amp; chunk_size = 0</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;    );</div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    </div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    <span class="comment">// transfrom and reduction</span></div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    <span class="comment">// ------------------------------------------------------------------------</span></div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;    </div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> BOP, <span class="keyword">typename</span> UOP&gt;</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#ad8d03524f15292610ebee63d53b89579">transform_reduce</a>(B&amp;&amp; first, E&amp;&amp; last, T&amp; init, BOP&amp;&amp; bop, UOP&amp;&amp; uop);</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;    </div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> BOP, <span class="keyword">typename</span> UOP, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#aa102a40672a331643944cb17c2377118">transform_reduce_guided</a>(</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, BOP&amp;&amp; bop, UOP&amp;&amp; uop, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    );</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;</div><div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> BOP, <span class="keyword">typename</span> UOP, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a562e253028680b61de95e305c0224d91">transform_reduce_static</a>(</div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, BOP&amp;&amp; bop, UOP&amp;&amp; uop, H&amp;&amp; chunk_size = 0</div><div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    );</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;</div><div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> B, <span class="keyword">typename</span> E, <span class="keyword">typename</span> T, <span class="keyword">typename</span> BOP, <span class="keyword">typename</span> UOP, <span class="keyword">typename</span> H = <span class="keywordtype">size_t</span>&gt;</div><div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a6fb87774919f4a570ac505cdcda48249">transform_reduce_dynamic</a>(</div><div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;      B&amp;&amp; first, E&amp;&amp; last, T&amp; init, BOP&amp;&amp; bop, UOP&amp;&amp; uop, H&amp;&amp; chunk_size = 1</div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    );</div><div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    </div><div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;    </div><div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;  <span class="keyword">protected</span>:</div><div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;    </div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    <a class="code" href="classtf_1_1FlowBuilder.html#a67d023d5493da1594a1d2eaea89da179">FlowBuilder</a>(Graph&amp; graph);</div><div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;    </div><div class="line"><a name="l00612"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">  612</a></span>&#160;    Graph&amp; <a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>;</div><div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;</div><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;  <span class="keyword">private</span>:</div><div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;</div><div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> L&gt;</div><div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    <span class="keywordtype">void</span> _linearize(L&amp;);</div><div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;};</div><div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;</div><div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;<span class="comment">// Constructor</span></div><div class="line"><a name="l00621"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a67d023d5493da1594a1d2eaea89da179">  621</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classtf_1_1FlowBuilder.html#a67d023d5493da1594a1d2eaea89da179">FlowBuilder::FlowBuilder</a>(Graph&amp; graph) :</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;  _graph {graph} {</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;}</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;</div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;<span class="comment">// Function: emplace</span></div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, std::enable_if_t&lt;is_static_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;*&gt;</div><div class="line"><a name="l00627"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">  627</a></span>&#160;<a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">FlowBuilder::emplace</a>(C&amp;&amp; c) {</div><div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classtf_1_1Task.html">Task</a>(<a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>.emplace_back(</div><div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;    std::in_place_type_t&lt;Node::StaticTask&gt;{}, std::forward&lt;C&gt;(c)</div><div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;  ));</div><div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;}</div><div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;</div><div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;<span class="comment">// Function: emplace</span></div><div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, std::enable_if_t&lt;is_dynamic_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;*&gt;</div><div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;<a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">FlowBuilder::emplace</a>(C&amp;&amp; c) {</div><div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classtf_1_1Task.html">Task</a>(<a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>.emplace_back(</div><div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;    std::in_place_type_t&lt;Node::DynamicTask&gt;{}, std::forward&lt;C&gt;(c)</div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;  ));</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;}</div><div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;</div><div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;<span class="comment">// Function: emplace</span></div><div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, std::enable_if_t&lt;is_condition_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;*&gt;</div><div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;Task <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">FlowBuilder::emplace</a>(C&amp;&amp; c) {</div><div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;  <span class="keywordflow">return</span> Task(<a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>.emplace_back(</div><div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    std::in_place_type_t&lt;Node::ConditionTask&gt;{}, std::forward&lt;C&gt;(c)</div><div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;  ));</div><div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;}</div><div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;</div><div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;<span class="preprocessor">#ifdef TF_ENABLE_CUDA</span></div><div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> C, std::enable_if_t&lt;is_cudaflow_task_v&lt;C&gt;, <span class="keywordtype">void</span>&gt;*&gt;</div><div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;Task <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">FlowBuilder::emplace</a>(C&amp;&amp; c) {</div><div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classtf_1_1FlowBuilder.html#afdf47fd1a358fb64f8c1b89e2a393169">emplace_on</a>(std::forward&lt;C&gt;(c), tf::cuda_get_device());</div><div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;}</div><div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;</div><div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;<span class="comment">// Function: emplace</span></div><div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span>... C, std::enable_if_t&lt;(<span class="keyword">sizeof</span>...(C)&gt;1), <span class="keywordtype">void</span>&gt;*&gt;</div><div class="line"><a name="l00658"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a1f6118326ad434f6c839007a1a79fe1b">  658</a></span>&#160;<span class="keyword">auto</span> <a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">FlowBuilder::emplace</a>(C&amp;&amp;... cs) {</div><div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;  <span class="keywordflow">return</span> std::make_tuple(<a class="code" href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">emplace</a>(std::forward&lt;C&gt;(cs))...);</div><div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;}</div><div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;</div><div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;<span class="comment">// Function: composed_of    </span></div><div class="line"><a name="l00663"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a0a01192f4f92c15380a4f259e2fec2d9">  663</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#a0a01192f4f92c15380a4f259e2fec2d9">FlowBuilder::composed_of</a>(<a class="code" href="classtf_1_1Taskflow.html">Taskflow</a>&amp; taskflow) {</div><div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;  <span class="keyword">auto</span> node = <a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>.emplace_back(</div><div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;    std::in_place_type_t&lt;Node::ModuleTask&gt;{}, &amp;taskflow</div><div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;  );</div><div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classtf_1_1Task.html">Task</a>(node);</div><div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;}</div><div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;</div><div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;<span class="comment">// Function: placeholder</span></div><div class="line"><a name="l00671"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#acab0b4ac82260f47fdb36a3244ee3aaf">  671</a></span>&#160;<span class="keyword">inline</span> <a class="code" href="classtf_1_1Task.html">Task</a> <a class="code" href="classtf_1_1FlowBuilder.html#acab0b4ac82260f47fdb36a3244ee3aaf">FlowBuilder::placeholder</a>() {</div><div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;  <span class="keyword">auto</span> node = <a class="code" href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">_graph</a>.emplace_back();</div><div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classtf_1_1Task.html">Task</a>(node);</div><div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;}</div><div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;</div><div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;<span class="comment">// Procedure: _linearize</span></div><div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> L&gt;</div><div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;<span class="keywordtype">void</span> FlowBuilder::_linearize(L&amp; keys) {</div><div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;</div><div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;  <span class="keyword">auto</span> itr = keys.begin();</div><div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;  <span class="keyword">auto</span> end = keys.end();</div><div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;</div><div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;  <span class="keywordflow">if</span>(itr == end) {</div><div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;    <span class="keywordflow">return</span>;</div><div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;  }</div><div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;</div><div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;  <span class="keyword">auto</span> nxt = itr;</div><div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;</div><div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;  <span class="keywordflow">for</span>(++nxt; nxt != end; ++nxt, ++itr) {</div><div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;    itr-&gt;_node-&gt;_precede(nxt-&gt;_node);</div><div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;  }</div><div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;}</div><div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;</div><div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;<span class="comment">// Procedure: linearize</span></div><div class="line"><a name="l00695"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">  695</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">FlowBuilder::linearize</a>(<a class="codeRef" doxygen="/Users/twhuang/PhD/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector&lt;Task&gt;</a>&amp; keys) {</div><div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;  _linearize(keys); </div><div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;}</div><div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;</div><div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;<span class="comment">// Procedure: linearize</span></div><div class="line"><a name="l00700"></a><span class="lineno"><a class="line" href="classtf_1_1FlowBuilder.html#a4ec89b554d15ad5fb96f4fdb10dbbb16">  700</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">FlowBuilder::linearize</a>(<a class="codeRef" doxygen="/Users/twhuang/PhD/Code/taskflow/doxygen/cppreference-doxygen-web.tag.xml:http://en.cppreference.com/w/" href="http://en.cppreference.com/w/cpp/utility/initializer_list.html">std::initializer_list&lt;Task&gt;</a> keys) {</div><div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;  _linearize(keys);</div><div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;}</div><div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;</div><div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;<span class="comment">// ----------------------------------------------------------------------------</span></div><div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;</div><div class="line"><a name="l00740"></a><span class="lineno"><a class="line" href="classtf_1_1Subflow.html">  740</a></span>&#160;<span class="keyword">class </span><a class="code" href="classtf_1_1Subflow.html">Subflow</a> : <span class="keyword">public</span> <a class="code" href="classtf_1_1FlowBuilder.html">FlowBuilder</a> {</div><div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;</div><div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classtf_1_1Executor.html">Executor</a>;</div><div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classtf_1_1FlowBuilder.html">FlowBuilder</a>;</div><div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;</div><div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;  <span class="keyword">public</span>:</div><div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;    </div><div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classtf_1_1Subflow.html#a59fcac1323e70d920088dd37bd0be245">join</a>();</div><div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;</div><div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classtf_1_1Subflow.html#acfdedc7e9676126e9a38ecf7b5a37864">detach</a>();</div><div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;    </div><div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classtf_1_1Subflow.html#a4c4b56476ca907ceca75dd8a861e1145">joinable</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;</div><div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;  <span class="keyword">private</span>:</div><div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;    </div><div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;    <a class="code" href="classtf_1_1Subflow.html">Subflow</a>(<a class="code" href="classtf_1_1Executor.html">Executor</a>&amp;, Node*, Graph&amp;);</div><div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;</div><div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;    <a class="code" href="classtf_1_1Executor.html">Executor</a>&amp; _executor;</div><div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;    Node* _parent;</div><div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;</div><div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;    <span class="keywordtype">bool</span> _joinable {<span class="keyword">true</span>};</div><div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;};</div><div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;</div><div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;<span class="comment">// Constructor</span></div><div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;<span class="keyword">inline</span> Subflow::Subflow(<a class="code" href="classtf_1_1Executor.html">Executor</a>&amp; executor, Node* parent, Graph&amp; graph) :</div><div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;  <a class="code" href="classtf_1_1FlowBuilder.html">FlowBuilder</a> {graph},</div><div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;  _executor   {executor},</div><div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;  _parent     {parent} {</div><div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;}</div><div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;</div><div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;<span class="comment">// Function: joined</span></div><div class="line"><a name="l00788"></a><span class="lineno"><a class="line" href="classtf_1_1Subflow.html#a4c4b56476ca907ceca75dd8a861e1145">  788</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classtf_1_1Subflow.html#a4c4b56476ca907ceca75dd8a861e1145">Subflow::joinable</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;  <span class="keywordflow">return</span> _joinable;</div><div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;}</div><div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;</div><div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;}  <span class="comment">// end of namespace tf. ---------------------------------------------------</span></div><div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;</div><div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;</div><div class="ttc" id="classtf_1_1FlowBuilder_html_a90f3d9b9d6fcf4df8e7d7878dfdd130d"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a90f3d9b9d6fcf4df8e7d7878dfdd130d">tf::FlowBuilder::linearize</a></div><div class="ttdeci">void linearize(std::vector&lt; Task &gt; &amp;tasks)</div><div class="ttdoc">adds adjacent dependency links to a linear list of tasks </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:695</div></div>
<div class="ttc" id="classtf_1_1Subflow_html_a4c4b56476ca907ceca75dd8a861e1145"><div class="ttname"><a href="classtf_1_1Subflow.html#a4c4b56476ca907ceca75dd8a861e1145">tf::Subflow::joinable</a></div><div class="ttdeci">bool joinable() const</div><div class="ttdoc">queries if the subflow is joinable </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:788</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a942449afd25e656b9e14cb526cbd8ad2"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a942449afd25e656b9e14cb526cbd8ad2">tf::FlowBuilder::for_each_index_guided</a></div><div class="ttdeci">Task for_each_index_guided(B &amp;&amp;beg, E &amp;&amp;end, S &amp;&amp;step, C &amp;&amp;callable, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs an index-based parallel-for task using the guided partition algorithm. ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_aa102a40672a331643944cb17c2377118"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#aa102a40672a331643944cb17c2377118">tf::FlowBuilder::transform_reduce_guided</a></div><div class="ttdeci">Task transform_reduce_guided(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, BOP &amp;&amp;bop, UOP &amp;&amp;uop, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel transform-reduce task using the guided partition algorithm ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a562e253028680b61de95e305c0224d91"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a562e253028680b61de95e305c0224d91">tf::FlowBuilder::transform_reduce_static</a></div><div class="ttdeci">Task transform_reduce_static(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, BOP &amp;&amp;bop, UOP &amp;&amp;uop, H &amp;&amp;chunk_size=0)</div><div class="ttdoc">constructs a STL-styled parallel transform-reduce task using the static partition algorithm ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a1a294c4fa23d74b82e581b8cfd33acdf"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a1a294c4fa23d74b82e581b8cfd33acdf">tf::FlowBuilder::for_each_guided</a></div><div class="ttdeci">Task for_each_guided(B &amp;&amp;beg, E &amp;&amp;end, C &amp;&amp;callable, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel-for task using the guided partition algorithm </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a6fb87774919f4a570ac505cdcda48249"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a6fb87774919f4a570ac505cdcda48249">tf::FlowBuilder::transform_reduce_dynamic</a></div><div class="ttdeci">Task transform_reduce_dynamic(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, BOP &amp;&amp;bop, UOP &amp;&amp;uop, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel transform-reduce task using the dynamic partition algorithm ...</div></div>
<div class="ttc" id="namespacetf_html"><div class="ttname"><a href="namespacetf.html">tf</a></div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:9</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a0af7e250c4ad1ae98bf6e0249b98589f"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a0af7e250c4ad1ae98bf6e0249b98589f">tf::FlowBuilder::for_each_static</a></div><div class="ttdeci">Task for_each_static(B &amp;&amp;beg, E &amp;&amp;end, C &amp;&amp;callable, H &amp;&amp;chunk_size=0)</div><div class="ttdoc">constructs a STL-styled parallel-for task using the dynamic partition algorithm </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a9404a57d9d37a4d49d20b686e4e5f68f"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a9404a57d9d37a4d49d20b686e4e5f68f">tf::FlowBuilder::_graph</a></div><div class="ttdeci">Graph &amp; _graph</div><div class="ttdoc">associated graph object </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:612</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_acab0b4ac82260f47fdb36a3244ee3aaf"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#acab0b4ac82260f47fdb36a3244ee3aaf">tf::FlowBuilder::placeholder</a></div><div class="ttdeci">Task placeholder()</div><div class="ttdoc">creates an empty task </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:671</div></div>
<div class="ttc" id="classtf_1_1Subflow_html_acfdedc7e9676126e9a38ecf7b5a37864"><div class="ttname"><a href="classtf_1_1Subflow.html#acfdedc7e9676126e9a38ecf7b5a37864">tf::Subflow::detach</a></div><div class="ttdeci">void detach()</div><div class="ttdoc">enables the subflow to detach from its parent task </div><div class="ttdef"><b>Definition:</b> executor.hpp:1384</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a83ec799606b7526787761acf27885b00"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a83ec799606b7526787761acf27885b00">tf::FlowBuilder::reduce_dynamic</a></div><div class="ttdeci">Task reduce_dynamic(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, O &amp;&amp;bop, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel-reduce task using the dynamic partition algorithm ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a54e36c916ae7dd88bd079d3fd49119f9"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a54e36c916ae7dd88bd079d3fd49119f9">tf::FlowBuilder::reduce_static</a></div><div class="ttdeci">Task reduce_static(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, O &amp;&amp;bop, H &amp;&amp;chunk_size=0)</div><div class="ttdoc">constructs a STL-styled parallel-reduce task using the static partition algorithm ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a71f204c670ca5857e5527d6000ba73c4"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a71f204c670ca5857e5527d6000ba73c4">tf::FlowBuilder::for_each_index_static</a></div><div class="ttdeci">Task for_each_index_static(B &amp;&amp;beg, E &amp;&amp;end, S &amp;&amp;step, C &amp;&amp;callable, H &amp;&amp;chunk_size=0)</div><div class="ttdoc">constructs an index-based parallel-for task using the static partition algorithm. ...</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_ab8417b211b18bb1e0f45a049331f084d"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#ab8417b211b18bb1e0f45a049331f084d">tf::FlowBuilder::for_each_index</a></div><div class="ttdeci">Task for_each_index(B &amp;&amp;first, E &amp;&amp;last, S &amp;&amp;step, C &amp;&amp;callable)</div><div class="ttdoc">constructs an index-based parallel-for task </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a0a01192f4f92c15380a4f259e2fec2d9"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a0a01192f4f92c15380a4f259e2fec2d9">tf::FlowBuilder::composed_of</a></div><div class="ttdeci">Task composed_of(Taskflow &amp;taskflow)</div><div class="ttdoc">creates a module task from a taskflow </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:663</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_ad999cd75045db225a42d5881d6db1223"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#ad999cd75045db225a42d5881d6db1223">tf::FlowBuilder::reduce</a></div><div class="ttdeci">Task reduce(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, O &amp;&amp;bop)</div><div class="ttdoc">constructs a STL-styled parallel-reduce task </div></div>
<div class="ttc" id="classtf_1_1Taskflow_html"><div class="ttname"><a href="classtf_1_1Taskflow.html">tf::Taskflow</a></div><div class="ttdoc">main entry to create a task dependency graph </div><div class="ttdef"><b>Definition:</b> core/taskflow.hpp:62</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a5c044a80450742bf6927d0c343c23853"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a5c044a80450742bf6927d0c343c23853">tf::FlowBuilder::for_each_dynamic</a></div><div class="ttdeci">Task for_each_dynamic(B &amp;&amp;beg, E &amp;&amp;end, C &amp;&amp;callable, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel-for task using the dynamic partition algorithm </div></div>
<div class="ttc" id="task_8hpp_html"><div class="ttname"><a href="task_8hpp.html">task.hpp</a></div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a67d023d5493da1594a1d2eaea89da179"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a67d023d5493da1594a1d2eaea89da179">tf::FlowBuilder::FlowBuilder</a></div><div class="ttdeci">FlowBuilder(Graph &amp;graph)</div><div class="ttdoc">constructs a flow builder with a graph </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:621</div></div>
<div class="ttc" id="vector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a564252001be679600b20ca9ed9920f6a"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a564252001be679600b20ca9ed9920f6a">tf::FlowBuilder::for_each</a></div><div class="ttdeci">Task for_each(B &amp;&amp;first, E &amp;&amp;last, C &amp;&amp;callable)</div><div class="ttdoc">constructs a STL-styled parallel-for task </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html"><div class="ttname"><a href="classtf_1_1FlowBuilder.html">tf::FlowBuilder</a></div><div class="ttdoc">building methods of a task dependency graph </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:17</div></div>
<div class="ttc" id="classtf_1_1Task_html"><div class="ttname"><a href="classtf_1_1Task.html">tf::Task</a></div><div class="ttdoc">handle to a node in a task dependency graph </div><div class="ttdef"><b>Definition:</b> task.hpp:120</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a930d0343226874d1d40b9e230cccdd52"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a930d0343226874d1d40b9e230cccdd52">tf::FlowBuilder::for_each_index_dynamic</a></div><div class="ttdeci">Task for_each_index_dynamic(B &amp;&amp;beg, E &amp;&amp;end, S &amp;&amp;step, C &amp;&amp;callable, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs an index-based parallel-for task using the dynamic partition algorithm. </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a60d7a666cab71ecfa3010b2efb0d6b57"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a60d7a666cab71ecfa3010b2efb0d6b57">tf::FlowBuilder::emplace</a></div><div class="ttdeci">Task emplace(C &amp;&amp;callable)</div><div class="ttdoc">creates a static task </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:627</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_ad8d03524f15292610ebee63d53b89579"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#ad8d03524f15292610ebee63d53b89579">tf::FlowBuilder::transform_reduce</a></div><div class="ttdeci">Task transform_reduce(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, BOP &amp;&amp;bop, UOP &amp;&amp;uop)</div><div class="ttdoc">constructs a STL-styled parallel transform-reduce task </div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_afdf47fd1a358fb64f8c1b89e2a393169"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#afdf47fd1a358fb64f8c1b89e2a393169">tf::FlowBuilder::emplace_on</a></div><div class="ttdeci">Task emplace_on(C &amp;&amp;callable, D &amp;&amp;device)</div><div class="ttdoc">creates a cudaflow task on the given device </div><div class="ttdef"><b>Definition:</b> executor.hpp:1403</div></div>
<div class="ttc" id="classtf_1_1Executor_html"><div class="ttname"><a href="classtf_1_1Executor.html">tf::Executor</a></div><div class="ttdoc">execution interface for running a taskflow graph </div><div class="ttdef"><b>Definition:</b> executor.hpp:28</div></div>
<div class="ttc" id="initializer_list_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/utility/initializer_list.html">std::initializer_list</a></div></div>
<div class="ttc" id="classtf_1_1Subflow_html"><div class="ttname"><a href="classtf_1_1Subflow.html">tf::Subflow</a></div><div class="ttdoc">class to construct a subflow graph from the execution of a dynamic task </div><div class="ttdef"><b>Definition:</b> flow_builder.hpp:740</div></div>
<div class="ttc" id="classtf_1_1Subflow_html_a59fcac1323e70d920088dd37bd0be245"><div class="ttname"><a href="classtf_1_1Subflow.html#a59fcac1323e70d920088dd37bd0be245">tf::Subflow::join</a></div><div class="ttdeci">void join()</div><div class="ttdoc">enables the subflow to join its parent task </div><div class="ttdef"><b>Definition:</b> executor.hpp:1374</div></div>
<div class="ttc" id="classtf_1_1FlowBuilder_html_a10f13b39b02038c6850aca787923d668"><div class="ttname"><a href="classtf_1_1FlowBuilder.html#a10f13b39b02038c6850aca787923d668">tf::FlowBuilder::reduce_guided</a></div><div class="ttdeci">Task reduce_guided(B &amp;&amp;first, E &amp;&amp;last, T &amp;init, O &amp;&amp;bop, H &amp;&amp;chunk_size=1)</div><div class="ttdoc">constructs a STL-styled parallel-reduce task using the guided partition algorithm ...</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_88dad41ea55ca2177e141d32a93e931c.html">taskflow</a></li><li class="navelem"><a class="el" href="dir_220cd4d9b8cb38c840b455d5d75c25bb.html">core</a></li><li class="navelem"><a class="el" href="flow__builder_8hpp.html">flow_builder.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
